﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Sealight.UI.WebUI.UIHelpers
{
    public class AdminViewEngine : VirtualPathProviderViewEngine
    {
        public AdminViewEngine()
        {
            //MasterLocationFormats = new[] {
            //    "~/Views/{1}/{0}.master",
            //    "~/Views/Shared/{0}.master"
            //};
            ViewLocationFormats = new[] {            
            "~/Views/AdminSite/{0}.ascx",
            "~/Views/AdminSite/{0}.aspx"          
        };
            PartialViewLocationFormats = ViewLocationFormats;
        }

        protected override IView CreatePartialView(ControllerContext controllerContext,
                                                   string partialPath)
        {
            return new WebFormView(controllerContext, partialPath, null);
        }

        protected override IView CreateView(ControllerContext controllerContext,
                                            string viewPath,
                                            string masterPath)
        {
            return new WebFormView(controllerContext, viewPath, masterPath);
        }
    }
}